Hoffman2 Happy Hour
🎉 Welcome to the Hoffman2 Happy Hours
📧 cpeterson@oarc.ucla.edu
This presentation and accompanying materials are available on UCLA OARC GitHub Repository 🔗 https://github.com/ucla-oarc-hpc
You can view the slides:
A powerful IDE for R, data visualization, and script management
But why do you want to use RStudio on Hoffman2 when you can use your own computer???
RStudio on Hoffman2 provides access to:
There are two main (free) RStudio formats that researchers can use
Standalone desktop application
Runs locally on the machine running R
RStudio Desktop
RStudio Server
Login to Hoffman2 via X11 Forwarding
The -X flag enables your local computer’s X11 server to display the RStudio GUI.
Connect via Remote Desktop
Information on using X11 and Remote Desktop on Hoffman2 can be found on our workshop Visualization application on HPC
Once connected to Hoffman2 via X11 or Remote Desktop,
If everything is set up correctly, the RStudio GUI will appear on your local computer or remote desktop.
Rstudio requires writable temporary directories outside of the container
It can be anywhere you have write access
apptainer run
-B $SCRATCH/rstudiotmp/[dir]:[/dir]
$H2_CONTAINER_LOC/h2-rstudio_4.1.0.sif
ssh -N -L ... info to be ranNote
KEEP THIS TERMINAL OPEN UNTIL YOU JOB IS DONE
Once Rstudio process is started:
Open another terminal on your local computer
Run the port forward command
8787 if needednXXX is the compute node nameusername is your Hoffman2 usernameThis will create a remote ssh connection from your local computer to the Hoffman2 compute node running Rstudio via port 8787
h2_rstudio.sh
h2-studio.sh Information
Look at our Github page
Tested Platforms
✅ Mac’s terminal app
✅ Window’s WSL2
✅ MoboXterm
❌ GitBash
This RStudio Script is currently on our GitHub page
This script will create an RStudio session on a compute node on Hoffman2.
REQUIRED OPTIONS:
-u [username] Your Hoffman2 username (mandatory)
OPTIONAL PARAMETERS:
-m [MEMORY] Memory requirements in GB (default: 10 GB)
-t [TIME] Time of RStudio job in HH:MM:SS (default: 2:00:00)
-v [VERSION] RStudio version (default: 4.1.0)
-p Request high-priority queue (highp)
-g [GPUTYPE] Request GPU resources, where GPUTYPE can be 'V100', 'A100', A6000, etc.
HELP:
-h Show this usage message$H2_CONTAINER_LOCh2-rstudio_X.Y.Z.sifX.Y.Z is the R version~/R/APPTAINER/h2-rstudio_4.1.0 (for h2_rstudio-4.1.0.sif)R Package Installs
#!/bin/bash
#$ -cwd
#$ -o rstudio_batch.out.$JOB_ID
#$ -j y
#$ -l h_rt=3:00:00,h_data=10G
#$ -pe shared 1
# Load the apptainer module
. /u/local/Modules/default/init/modules.sh
module load apptainer
# R Version
export RSTUDIO_VER=4.4.0
# Use the RStudio container to run R code
apptainer run $H2_CONTAINER_LOC/h2-rstudio_${RSTUDIO_VER}.sif R CMD BATCH myRtest.R